package
{
	import event.UIEditsEventName;
	
	import fl.controls.CheckBox;
	import fl.controls.ScrollBarDirection;
	import fl.controls.ScrollPolicy;
	import fl.controls.TileList;
	import fl.data.DataProvider;
	import fl.events.ListEvent;
	
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLLoaderDataFormat;
	import flash.utils.ByteArray;
	import flash.utils.getDefinitionByName;
	
	import kingsAsLib.displays.Controls.KLabel;
	import kingsAsLib.displays.Controls.KScrollBarContent;
	import kingsAsLib.displays.Controls.Klist;
	import kingsAsLib.displays.ReferenceWin;
	import kingsAsLib.events.EventManager;
	import kingsAsLib.events.KEvents;
	import kingsAsLib.nets.KUrlLoader;
	import kingsAsLib.systems.KSwfDataPool;
	import kingsAsLib.air.KFileDirectory;
	import kingsAsLib.air.KwriterFile;

	/**
	 * @author kings
	 * @E-mail: qywangweiqiang@126.com
	 * 2012-11-29上午12:45:34
	 * */
	public class LoadFileList
	{
		private var _classArr:Vector.<String>=new Vector.<String>;

		static private var loadFileList:LoadFileList=new LoadFileList();

		public function LoadFileList()
		{

		}

		static public function getInstance():LoadFileList
		{
			return loadFileList;
		}

		public function loadFileList():void
		{
			// 
			var kurl:KUrlLoader=new KUrlLoader();
			kurl.loaderStars("flieList.txt", loadCompleteFun, null, URLLoaderDataFormat.TEXT);
		}

		private function loadCompleteFun(obj:String):void
		{
			var arr:Array=obj.split(",");
			var myPattern:RegExp=/\//gi;
			for (var i:int=0; i < arr.length; i++)
			{
				var str:String=arr[i];
				var temp:String=str.replace(myPattern, ".");
				var temp2:String=temp.substr(0, temp.length - 3);
				classArr.push(temp2);
			}
			EventManager.dispatchEvent(new KEvents(UIEditsEventName.loadFileListComplete,0));
		}

		public function get classArr():Vector.<String>
		{
			return _classArr;
		}

		public function set classArr(value:Vector.<String>):void
		{
			_classArr=value;
		}

	}

	//end class
}
